package com.lbs.tdrive.adapter;





import com.lbs.tdrive.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MenuAdapter extends BaseAdapter {

	private String[] options={"Route",
			"My Vehicles",
			"Travel Cost",
			"Weather",
			"Alert",
			"About",
			"Exit"};
	private Context ctx;
	
	private int[] optionResources = {R.drawable.dashboard,
			R.drawable.news,
			R.drawable.memo,
			R.drawable.policies,
			R.drawable.sharing,
			R.drawable.settings,
			R.drawable.signout
	};
	public MenuAdapter(Context ctx){
		this.ctx=ctx;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return options.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = LayoutInflater.from(ctx);
		View v =  inflater.inflate(R.layout.menuoption, null);
		ImageView iv = (ImageView) v.findViewById(R.id.imageView1);
		TextView tv = (TextView) v.findViewById(R.id.textView1);
		iv.setBackgroundResource(optionResources[position]);
		tv.setText("   "+options[position]);
		return v;
	}

}
